﻿<%
	function Get_Subject_Name(SubjectID)
		dim rs,sql
		sql = "select * from [SUBJECT] where ID = '"& SubjectID &"'"
		set rs = db.query(sql)
		if not rs.eof then
			Get_Subject_Name = rs("NAME")
		else
			Get_Subject_Name = ""
		end if
		rs.close
		set rs = nothing
	end function
	
	'转换日期格式
	function DateFormat(d)
		dim yy,mm,dd
		yy = year(d)
		mm = month(d)
		dd = day(d)
		
		if len(mm) <> 2 then mm = 0 & mm
		if len(dd) <> 2 then dd = 0 & dd
		
		DateFormat = yy & "-" & mm & "-" & dd
	end function
	
	'截取内容
	function CutTitle(title,length)
		if len(title) <= length then
			CutTitle = title
		else
			CutTitle = left(title,length) & "..."
		end if
	end function
%>